package com.borball.store.domain;

import java.io.Serializable;
import java.sql.Timestamp;

public class OrderItem implements Serializable {

	private static final long serialVersionUID = 4592662972398816380L;

	private int id;
	private int orderId;
	private String name;
	private String unit;
	private int amount;
	private float price;
	private float total;
	private String purpose;
	private String status;
	private ProductOrder order;
	private String customer;
	private Timestamp created;
	public String getCustomer() {
		return order.getCustomer();
	}

	public Timestamp getCreated() {
		return order.getCreated();
	}

	public String getUser() {
		return order.getUser();
	}

	public String getOperator() {
		return order.getOperator();
	}

	private String user;
	private String operator;
	
	public ProductOrder getOrder() {
		return order;
	}

	public void setOrder(ProductOrder order) {
		this.order = order;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public int getOrderId() {
		return orderId;
	}

	public void setOrderId(int orderId) {
		this.orderId = orderId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getUnit() {
		return unit;
	}

	public void setUnit(String unit) {
		this.unit = unit;
	}

	public int getAmount() {
		return amount;
	}

	public void setAmount(int amount) {
		this.amount = amount;
	}

	public float getPrice() {
		return price;
	}

	public void setPrice(float price) {
		this.price = price;
	}

	public float getTotal() {
		return total;
	}

	public void setTotal(float total) {
		this.total = total;
	}

	public String getPurpose() {
		return purpose;
	}

	public void setPurpose(String purpose) {
		this.purpose = purpose;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	@Override
	public boolean equals(Object obj) {
		if(obj instanceof OrderItem){
			OrderItem oi = (OrderItem)obj;
			return id == oi.getId() && orderId == oi.getOrderId(); 
		}
		return false;

	}

}
